home *** CD-ROM | disk | FTP | other *** search
/ Toy Story Free! Interactive / Toy Story.iso / pc / DATA / quote.swf / scripts / frame_63 / DoAction.as
Encoding:
Text File  |  2010-01-27  |  655 b   |  31 lines

  1. function shuffle(arr)
  2. {
  3.    var _loc5_ = arr.length - 1;
  4.    var _loc1_ = _loc5_;
  5.    while(_loc1_ >= 0)
  6.    {
  7.       var _loc3_ = Math.floor(Math.random() * (_loc1_ + 1));
  8.       var _loc4_ = arr[_loc1_];
  9.       arr[_loc1_] = arr[_loc3_];
  10.       arr[_loc3_] = _loc4_;
  11.       _loc1_ = _loc1_ - 1;
  12.    }
  13. }
  14. function gotoNextLabel()
  15. {
  16.    if(currentLabel < 10)
  17.    {
  18.       gotoAndPlay(labels[currentLabel]);
  19.       currentLabel++;
  20.    }
  21.    else
  22.    {
  23.       gotoAndStop("end");
  24.    }
  25. }
  26. var score = 0;
  27. var labels = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r"];
  28. shuffle(labels);
  29. var currentLabel = 0;
  30. gotoNextLabel();
  31.